Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regex filtering #806

Merged
merged 1 commit into from
Apr 30, 2024
Merged

Add regex filtering #806

merged 1 commit into from
Apr 30, 2024

Conversation

imwints
Copy link
Contributor

@imwints imwints commented Mar 20, 2024

Filters starting with '!' will try to match processes pid, name, cmd and user with extended regex as defined by the C++ standard. A single '!' will not filter.

Partially implements #387, but is missing the option to filter by type, meaning by user or command only.

Copy link

@mrlee14 mrlee14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wrorks!

@imwints imwints force-pushed the regex-search branch 2 times, most recently from 8086431 to dd0e8a3 Compare April 7, 2024 12:03
@aristocratos
Copy link
Owner

@imwints Looks good! But should do some performance testing on how the filtering behaves before and after.

Should likely be faster, but you never know.

Filters starting with '!' will try to match processes pid, name, cmd and
user with extended regex as defined by the C++ standard. A single '!'
will not filter.
@imwints
Copy link
Contributor Author

imwints commented Apr 30, 2024

The regex search will likely slow things down a lot. But since the regex matching is only performed with the leading '!' I'm pretty sure the normal search is not impacted.

@aristocratos
Copy link
Owner

But since the regex matching is only performed with the leading '!' [...]

Ah, right :)
Well the extra branch would slow it down, but nothing noticeable.

Nice work!

@aristocratos aristocratos merged commit 3b65b3a into aristocratos:main Apr 30, 2024
52 checks passed
@imwints imwints deleted the regex-search branch April 30, 2024 15:31
@imwints
Copy link
Contributor Author

imwints commented Apr 30, 2024

@aristocratos

Here is just a simple comparison without any context...

@aristocratos
Copy link
Owner

@imwints
Ouch!
Doesn't seem to be any faster even if the regex is static...
But on the other hand, this isn't anything that will be noticeable in human time scales.

@yogasw
Copy link

yogasw commented Dec 9, 2024

how use this feature, I try !chrome but the result does not show all processes other than chrome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants